home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
413_01
/
sndblst4
/
rawin.c
< prev
next >
Wrap
Text File
|
1993-12-10
|
1KB
|
48 lines
//------------------------------------------------------------------------------
// Copyright (c) David Welch, 1993
//------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sb.h"
unsigned char ca;
unsigned short ra;
unsigned long la;
FILE *fp;
unsigned char gstring[80];
unsigned long dLen;
//------------------------------------------------------------------------------
void main ( int argc, char *argv[] )
{
if(argc<3)
{
printf("RAWIN [d:][path]filename[.ext] samplerate\n");
exit(1);
}
if((fp=fopen(argv[1],"wb"))==0)
{
printf("Error creating file [%s]\n",argv[1]);
exit(1);
}
printf("FILE: [%s]\n",argv[1]);
sbinit();
sbmalloc();
ra=atoi(argv[2]);
printf("Samples Per Second %u\n",ra);
ca=256UL-(1000000UL/ra);
printf("Time Constant %u\n",ca);
sbsettc(ca);
sbrec(65000);
printf("Recording 65000 samples\n");
// while(dmacount()!=0xFFFF);
dmastatus();
while(!dmastatus()) continue;
fwrite(aligned,1,65000,fp);
}
//------------------------------------------------------------------------------
// Copyright (c) David Welch, 1993
//------------------------------------------------------------------------------